package com.storm.auth.controller

import com.storm.auth.model.data.JwtUser
import com.storm.auth.service.AuthService
import com.storm.common.response.JSONResponse
import com.storm.common.response.success
import com.storm.util.log
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/userCenter/auth")
class AuthController(private val authService: AuthService) {

    /**
     * 根据登入用户名获取用户信息
     */
    @GetMapping("/getUserByLoginName/{loginName}")
    @ResponseBody
    fun getUserByLoginName(@PathVariable loginName:String): JSONResponse<JwtUser> {
        log.info("根据登入用户名获取用户信息---getUserByLoginName,loginName:{}", loginName)
        return success(authService.getJwtUserByLoginName(loginName))

    }
}
